3.41 \(\int \cos ^2(c+d x) (a+i a \tan (c+d x))^3 \, dx\)

Optimal. Leaf size=49 \[ -\frac{2 i a^4}{d (a-i a \tan (c+d x))}+\frac{i a^3 \log (\cos (c+d x))}{d}-a^3 x \]

[Out]

-(a^3*x) + (I*a^3*Log[Cos[c + d*x]])/d - ((2*I)*a^4)/(d*(a - I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0486997, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3487, 43} \[ -\frac{2 i a^4}{d (a-i a \tan (c+d x))}+\frac{i a^3 \log (\cos (c+d x))}{d}-a^3 x \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(a + I*a*Tan[c + d*x])^3,x]

[Out]

-(a^3*x) + (I*a^3*Log[Cos[c + d*x]])/d - ((2*I)*a^4)/(d*(a - I*a*Tan[c + d*x]))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \cos ^2(c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \frac{a+x}{(a-x)^2} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \left (\frac{2 a}{(a-x)^2}+\frac{1}{-a+x}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-a^3 x+\frac{i a^3 \log (\cos (c+d x))}{d}-\frac{2 i a^4}{d (a-i a \tan (c+d x))}\\ \end{align*}

Mathematica [B]  time = 0.277116, size = 99, normalized size = 2.02 \[ -\frac{a^3 (\cos (c+4 d x)+i \sin (c+4 d x)) \left (\cos (c+d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x+2 i\right )+\sin (c+d x) \left (-\log \left (\cos ^2(c+d x)\right )-2 i d x-2\right )\right )}{2 d (\cos (d x)+i \sin (d x))^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(a + I*a*Tan[c + d*x])^3,x]

[Out]

-(a^3*(Cos[c + d*x]*(2*I + 2*d*x - I*Log[Cos[c + d*x]^2]) + (-2 - (2*I)*d*x - Log[Cos[c + d*x]^2])*Sin[c + d*x
])*(Cos[c + 4*d*x] + I*Sin[c + 4*d*x]))/(2*d*(Cos[d*x] + I*Sin[d*x])^3)

________________________________________________________________________________________

Maple [A]  time = 0.051, size = 87, normalized size = 1.8 \begin{align*}{\frac{{\frac{i}{2}}{a}^{3} \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{i{a}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+2\,{\frac{{a}^{3}\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{d}}-{a}^{3}x-{\frac{{a}^{3}c}{d}}-{\frac{{\frac{3\,i}{2}}{a}^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{2}}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^3,x)

[Out]

1/2*I/d*a^3*sin(d*x+c)^2+I*a^3*ln(cos(d*x+c))/d+2/d*a^3*sin(d*x+c)*cos(d*x+c)-a^3*x-1/d*a^3*c-3/2*I/d*a^3*cos(
d*x+c)^2

________________________________________________________________________________________

Maxima [A]  time = 1.69114, size = 84, normalized size = 1.71 \begin{align*} -\frac{2 \,{\left (d x + c\right )} a^{3} + i \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac{4 \,{\left (a^{3} \tan \left (d x + c\right ) - i \, a^{3}\right )}}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/2*(2*(d*x + c)*a^3 + I*a^3*log(tan(d*x + c)^2 + 1) - 4*(a^3*tan(d*x + c) - I*a^3)/(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.18139, size = 93, normalized size = 1.9 \begin{align*} \frac{-i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

(-I*a^3*e^(2*I*d*x + 2*I*c) + I*a^3*log(e^(2*I*d*x + 2*I*c) + 1))/d

________________________________________________________________________________________

Sympy [A]  time = 0.709498, size = 53, normalized size = 1.08 \begin{align*} 2 a^{3} \left (\begin{cases} - \frac{i e^{2 i d x}}{2 d} & \text{for}\: d \neq 0 \\x & \text{otherwise} \end{cases}\right ) e^{2 i c} + \frac{i a^{3} \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a+I*a*tan(d*x+c))**3,x)

[Out]

2*a**3*Piecewise((-I*exp(2*I*d*x)/(2*d), Ne(d, 0)), (x, True))*exp(2*I*c) + I*a**3*log(exp(2*I*d*x) + exp(-2*I
*c))/d

________________________________________________________________________________________

Giac [A]  time = 1.25177, size = 49, normalized size = 1. \begin{align*} \frac{-i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

(-I*a^3*e^(2*I*d*x + 2*I*c) + I*a^3*log(e^(2*I*d*x + 2*I*c) + 1))/d